package com.neusoft.work.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.work.dto.CheckOutRegistrationDto;
import com.neusoft.work.dto.ClientInfoDTO;
import com.neusoft.work.po.CheckOutRegistration;
import com.neusoft.work.po.PageResponseBean;
import com.neusoft.work.po.ResponseBean;
import com.neusoft.work.service.CheckOutRegistrationService;


@RequestMapping("/CheckOutRegistrationController")
@RestController
public class CheckOutRegistrationController {

    @Autowired
    private CheckOutRegistrationService service;

    @RequestMapping("/queryAll")
    public PageResponseBean<List<CheckOutRegistrationDto>> queryAll(String name,Long cur, Long number) {
        return service.queryAll(name, cur, number);
    }

    @RequestMapping("/add")
    public ResponseBean<Integer> add(CheckOutRegistration record) {
    	return service.add(record);
    }
    
    @RequestMapping("/update")
    public ResponseBean<Integer> update(CheckOutRegistration record) {
    	return service.update(record);
    }


    @RequestMapping("/delete")
    public ResponseBean<Integer> delete(Integer id) {
    	return service.delete(id);
    }

    @PostMapping("/approve")
    public ResponseBean<Integer> approve(Integer id,
                                      Integer approveStatus,
                                      Integer operatorUserId) {
        return service.approve(id, approveStatus, operatorUserId);
    }

    @RequestMapping("/searchClient")
    public PageResponseBean<List<ClientInfoDTO>> searchClient(Integer healthManagerId, String clientName, Long cur, Long number) {
        return service.searchClient(healthManagerId,clientName, cur, number);
    }

    @RequestMapping("/checkOutRegister")
    public ResponseBean<Integer> checkOutRegister(CheckOutRegistration checkOutRegistration) {
        return service.checkOutRegister(checkOutRegistration);
    }

    @RequestMapping("/searchRegistration")
    public PageResponseBean<List<CheckOutRegistrationDto>> searchRegistration(Integer healthManagerId, String clientName, Long cur, Long number) {
        return service.searchRegistration(healthManagerId, clientName, cur, number);
    }
}
